﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Enuo.Dotnet.Core.Model
{
  public class ServcieResult<T>  // where T : BaseEntity
  {
    public ServcieResult()
    {

    }

    public ServcieResult(T data)
    {
      this.success = true;
      this.code = 200;
      this.msg = "OK";
      this.data = data;
    }

    public ServcieResult(int code, string msg, T data)
    {
      this.success = code == 200;
      this.code = code;
      this.data = data;
      this.msg = msg;
    }

    public bool success { get; set; }
    public string msg { get; set; }
    public int code { get; set; }
    public T data { get; set; }
  }
}
